<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MathArrays (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MathArrays (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MathArrays.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/util/IterationManager.html" title="class in org.apache.commons.math3.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/util/MathArrays.Function.html" title="interface in org.apache.commons.math3.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/util/MathArrays.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MathArrays.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.util</FONT>
<BR>
Class MathArrays</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.util.MathArrays</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>MathArrays</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>

<P>
Arrays utilities.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>3.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: MathArrays.java 1462423 2013-03-29 07:25:18Z luc $</DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;interface</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.Function.html" title="interface in org.apache.commons.math3.util">MathArrays.Function</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Real-valued function that operate on an array or a part of it.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specification of ordering direction.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T[]</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#buildArray(org.apache.commons.math3.Field, int)">buildArray</A></B>(<A HREF="../../../../../org/apache/commons/math3/Field.html" title="interface in org.apache.commons.math3">Field</A>&lt;T&gt;&nbsp;field,
           int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build an array of elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T[][]</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#buildArray(org.apache.commons.math3.Field, int, int)">buildArray</A></B>(<A HREF="../../../../../org/apache/commons/math3/Field.html" title="interface in org.apache.commons.math3">Field</A>&lt;T&gt;&nbsp;field,
           int&nbsp;rows,
           int&nbsp;columns)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build a double dimension  array of elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkNonNegative(long[])">checkNonNegative</A></B>(long[]&nbsp;in)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that all entries of the input array are >= 0.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkNonNegative(long[][])">checkNonNegative</A></B>(long[][]&nbsp;in)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check all entries of the input array are >= 0.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkOrder(double[])">checkOrder</A></B>(double[]&nbsp;val)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that the given array is sorted in strictly increasing order.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkOrder(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)">checkOrder</A></B>(double[]&nbsp;val,
           <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
           boolean&nbsp;strict)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that the given array is sorted.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkOrder(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean, boolean)">checkOrder</A></B>(double[]&nbsp;val,
           <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
           boolean&nbsp;strict,
           boolean&nbsp;abort)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that the given array is sorted.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkPositive(double[])">checkPositive</A></B>(double[]&nbsp;in)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that all entries of the input array are strictly positive.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#checkRectangular(long[][])">checkRectangular</A></B>(long[][]&nbsp;in)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Throws DimensionMismatchException if the input array is not rectangular.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#copyOf(double[])">copyOf</A></B>(double[]&nbsp;source)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of the <code>source</code> array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#copyOf(double[], int)">copyOf</A></B>(double[]&nbsp;source,
       int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of the <code>source</code> array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#copyOf(int[])">copyOf</A></B>(int[]&nbsp;source)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of the <code>source</code> array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#copyOf(int[], int)">copyOf</A></B>(int[]&nbsp;source,
       int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a copy of the <code>source</code> array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distance(double[], double[])">distance</A></B>(double[]&nbsp;p1,
         double[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>2</sub> (Euclidean) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distance(int[], int[])">distance</A></B>(int[]&nbsp;p1,
         int[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>2</sub> (Euclidean) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distance1(double[], double[])">distance1</A></B>(double[]&nbsp;p1,
          double[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>1</sub> (sum of abs) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distance1(int[], int[])">distance1</A></B>(int[]&nbsp;p1,
          int[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>1</sub> (sum of abs) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distanceInf(double[], double[])">distanceInf</A></B>(double[]&nbsp;p1,
            double[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>&infin;</sub> (max of abs) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#distanceInf(int[], int[])">distanceInf</A></B>(int[]&nbsp;p1,
            int[]&nbsp;p2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculates the L<sub>&infin;</sub> (max of abs) distance between two points.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#ebeAdd(double[], double[])">ebeAdd</A></B>(double[]&nbsp;a,
       double[]&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an array whose contents will be the element-by-element
 addition of the arguments.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#ebeDivide(double[], double[])">ebeDivide</A></B>(double[]&nbsp;a,
          double[]&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an array whose contents will be the element-by-element
 division of the first argument by the second.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#ebeMultiply(double[], double[])">ebeMultiply</A></B>(double[]&nbsp;a,
            double[]&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an array whose contents will be the element-by-element
 multiplication of the arguments.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#ebeSubtract(double[], double[])">ebeSubtract</A></B>(double[]&nbsp;a,
            double[]&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an array whose contents will be the element-by-element
 subtraction of the second argument from the first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#equals(double[], double[])">equals</A></B>(double[]&nbsp;x,
       double[]&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> iff both arguments are <code>null</code> or have same
 dimensions and all their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equals(double, double)"><CODE>Precision.equals(double,double)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#equals(float[], float[])">equals</A></B>(float[]&nbsp;x,
       float[]&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true iff both arguments are null or have same dimensions and all
 their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equals(float, float)"><CODE>Precision.equals(float,float)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#equalsIncludingNaN(double[], double[])">equalsIncludingNaN</A></B>(double[]&nbsp;x,
                   double[]&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> iff both arguments are <code>null</code> or have same
 dimensions and all their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equalsIncludingNaN(double, double)"><CODE>this method</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#equalsIncludingNaN(float[], float[])">equalsIncludingNaN</A></B>(float[]&nbsp;x,
                   float[]&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true iff both arguments are null or have same dimensions and all
 their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equalsIncludingNaN(double, double)"><CODE>this method</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#isMonotonic(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)">isMonotonic</A></B>(double[]&nbsp;val,
            <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
            boolean&nbsp;strict)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that an array is monotonically increasing or decreasing.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;? super T&gt;&gt; 
<BR>
boolean</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#isMonotonic(T[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)">isMonotonic</A></B>(T[]&nbsp;val,
            <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
            boolean&nbsp;strict)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check that an array is monotonically increasing or decreasing.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double[], double[])">linearCombination</A></B>(double[]&nbsp;a,
                  double[]&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compute a linear combination accurately.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double)">linearCombination</A></B>(double&nbsp;a1,
                  double&nbsp;b1,
                  double&nbsp;a2,
                  double&nbsp;b2)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compute a linear combination accurately.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double)">linearCombination</A></B>(double&nbsp;a1,
                  double&nbsp;b1,
                  double&nbsp;a2,
                  double&nbsp;b2,
                  double&nbsp;a3,
                  double&nbsp;b3)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compute a linear combination accurately.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double, double, double)">linearCombination</A></B>(double&nbsp;a1,
                  double&nbsp;b1,
                  double&nbsp;a2,
                  double&nbsp;b2,
                  double&nbsp;a3,
                  double&nbsp;b3,
                  double&nbsp;a4,
                  double&nbsp;b4)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compute a linear combination accurately.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#normalizeArray(double[], double)">normalizeArray</A></B>(double[]&nbsp;values,
               double&nbsp;normalizedSum)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Normalizes an array to make it sum to a specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#safeNorm(double[])">safeNorm</A></B>(double[]&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the Cartesian norm (2-norm), handling both overflow and underflow.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#scale(double, double[])">scale</A></B>(double&nbsp;val,
      double[]&nbsp;arr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a copy of an array scaled by a value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#scaleInPlace(double, double[])">scaleInPlace</A></B>(double&nbsp;val,
             double[]&nbsp;arr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Multiply each element of an array by a value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#sortInPlace(double[], double[]...)">sortInPlace</A></B>(double[]&nbsp;x,
            double[]...&nbsp;yList)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sort an array in ascending order in place and perform the same reordering
 of entries on other arrays.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#sortInPlace(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, double[]...)">sortInPlace</A></B>(double[]&nbsp;x,
            <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
            double[]...&nbsp;yList)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sort an array in place and perform the same reordering of entries on
 other arrays.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="scale(double, double[])"><!-- --></A><H3>
scale</H3>
<PRE>
public static double[] <B>scale</B>(double&nbsp;val,
                             double[]&nbsp;arr)</PRE>
<DL>
<DD>Create a copy of an array scaled by a value.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>arr</CODE> - Array to scale.<DD><CODE>val</CODE> - Scalar.
<DT><B>Returns:</B><DD>scaled copy of array with each entry multiplied by val.<DT><B>Since:</B></DT>
  <DD>3.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="scaleInPlace(double, double[])"><!-- --></A><H3>
scaleInPlace</H3>
<PRE>
public static void <B>scaleInPlace</B>(double&nbsp;val,
                                double[]&nbsp;arr)</PRE>
<DL>
<DD><p>Multiply each element of an array by a value.</p>

 <p>The array is modified in place (no copy is created).</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>arr</CODE> - Array to scale<DD><CODE>val</CODE> - Scalar<DT><B>Since:</B></DT>
  <DD>3.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="ebeAdd(double[], double[])"><!-- --></A><H3>
ebeAdd</H3>
<PRE>
public static double[] <B>ebeAdd</B>(double[]&nbsp;a,
                              double[]&nbsp;b)
                       throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Creates an array whose contents will be the element-by-element
 addition of the arguments.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - First term of the addition.<DD><CODE>b</CODE> - Second term of the addition.
<DT><B>Returns:</B><DD>a new array <code>r</code> where <code>r[i] = a[i] + b[i]</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if the array lengths differ.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="ebeSubtract(double[], double[])"><!-- --></A><H3>
ebeSubtract</H3>
<PRE>
public static double[] <B>ebeSubtract</B>(double[]&nbsp;a,
                                   double[]&nbsp;b)
                            throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Creates an array whose contents will be the element-by-element
 subtraction of the second argument from the first.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - First term.<DD><CODE>b</CODE> - Element to be subtracted.
<DT><B>Returns:</B><DD>a new array <code>r</code> where <code>r[i] = a[i] - b[i]</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if the array lengths differ.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="ebeMultiply(double[], double[])"><!-- --></A><H3>
ebeMultiply</H3>
<PRE>
public static double[] <B>ebeMultiply</B>(double[]&nbsp;a,
                                   double[]&nbsp;b)
                            throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Creates an array whose contents will be the element-by-element
 multiplication of the arguments.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - First factor of the multiplication.<DD><CODE>b</CODE> - Second factor of the multiplication.
<DT><B>Returns:</B><DD>a new array <code>r</code> where <code>r[i] = a[i] * b[i]</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if the array lengths differ.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="ebeDivide(double[], double[])"><!-- --></A><H3>
ebeDivide</H3>
<PRE>
public static double[] <B>ebeDivide</B>(double[]&nbsp;a,
                                 double[]&nbsp;b)
                          throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Creates an array whose contents will be the element-by-element
 division of the first argument by the second.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - Numerator of the division.<DD><CODE>b</CODE> - Denominator of the division.
<DT><B>Returns:</B><DD>a new array <code>r</code> where <code>r[i] = a[i] / b[i]</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if the array lengths differ.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="distance1(double[], double[])"><!-- --></A><H3>
distance1</H3>
<PRE>
public static double <B>distance1</B>(double[]&nbsp;p1,
                               double[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>1</sub> (sum of abs) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>1</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="distance1(int[], int[])"><!-- --></A><H3>
distance1</H3>
<PRE>
public static int <B>distance1</B>(int[]&nbsp;p1,
                            int[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>1</sub> (sum of abs) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>1</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="distance(double[], double[])"><!-- --></A><H3>
distance</H3>
<PRE>
public static double <B>distance</B>(double[]&nbsp;p1,
                              double[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>2</sub> (Euclidean) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>2</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="distance(int[], int[])"><!-- --></A><H3>
distance</H3>
<PRE>
public static double <B>distance</B>(int[]&nbsp;p1,
                              int[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>2</sub> (Euclidean) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>2</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="distanceInf(double[], double[])"><!-- --></A><H3>
distanceInf</H3>
<PRE>
public static double <B>distanceInf</B>(double[]&nbsp;p1,
                                 double[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>&infin;</sub> (max of abs) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>&infin;</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="distanceInf(int[], int[])"><!-- --></A><H3>
distanceInf</H3>
<PRE>
public static int <B>distanceInf</B>(int[]&nbsp;p1,
                              int[]&nbsp;p2)</PRE>
<DL>
<DD>Calculates the L<sub>&infin;</sub> (max of abs) distance between two points.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>p1</CODE> - the first point<DD><CODE>p2</CODE> - the second point
<DT><B>Returns:</B><DD>the L<sub>&infin;</sub> distance between the two points</DL>
</DD>
</DL>
<HR>

<A NAME="isMonotonic(java.lang.Comparable[],org.apache.commons.math3.util.MathArrays.OrderDirection,boolean)"><!-- --></A><A NAME="isMonotonic(T[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)"><!-- --></A><H3>
isMonotonic</H3>
<PRE>
public static &lt;T extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;? super T&gt;&gt; boolean <B>isMonotonic</B>(T[]&nbsp;val,
                                                                    <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
                                                                    boolean&nbsp;strict)</PRE>
<DL>
<DD>Check that an array is monotonically increasing or decreasing.
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the elements in the specified array<DT><B>Parameters:</B><DD><CODE>val</CODE> - Values.<DD><CODE>dir</CODE> - Ordering direction.<DD><CODE>strict</CODE> - Whether the order should be strict.
<DT><B>Returns:</B><DD><code>true</code> if sorted, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>

<A NAME="isMonotonic(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)"><!-- --></A><H3>
isMonotonic</H3>
<PRE>
public static boolean <B>isMonotonic</B>(double[]&nbsp;val,
                                  <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
                                  boolean&nbsp;strict)</PRE>
<DL>
<DD>Check that an array is monotonically increasing or decreasing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>val</CODE> - Values.<DD><CODE>dir</CODE> - Ordering direction.<DD><CODE>strict</CODE> - Whether the order should be strict.
<DT><B>Returns:</B><DD><code>true</code> if sorted, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>

<A NAME="checkOrder(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean, boolean)"><!-- --></A><H3>
checkOrder</H3>
<PRE>
public static boolean <B>checkOrder</B>(double[]&nbsp;val,
                                 <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
                                 boolean&nbsp;strict,
                                 boolean&nbsp;abort)
                          throws <A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></PRE>
<DL>
<DD>Check that the given array is sorted.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>val</CODE> - Values.<DD><CODE>dir</CODE> - Ordering direction.<DD><CODE>strict</CODE> - Whether the order should be strict.<DD><CODE>abort</CODE> - Whether to throw an exception if the check fails.
<DT><B>Returns:</B><DD><code>true</code> if the array is sorted.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></CODE> - if the array is not sorted
 and <code>abort</code> is <code>true</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="checkOrder(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, boolean)"><!-- --></A><H3>
checkOrder</H3>
<PRE>
public static void <B>checkOrder</B>(double[]&nbsp;val,
                              <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
                              boolean&nbsp;strict)
                       throws <A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></PRE>
<DL>
<DD>Check that the given array is sorted.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>val</CODE> - Values.<DD><CODE>dir</CODE> - Ordering direction.<DD><CODE>strict</CODE> - Whether the order should be strict.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></CODE> - if the array is not sorted.<DT><B>Since:</B></DT>
  <DD>2.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="checkOrder(double[])"><!-- --></A><H3>
checkOrder</H3>
<PRE>
public static void <B>checkOrder</B>(double[]&nbsp;val)
                       throws <A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></PRE>
<DL>
<DD>Check that the given array is sorted in strictly increasing order.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>val</CODE> - Values.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NonMonotonicSequenceException.html" title="class in org.apache.commons.math3.exception">NonMonotonicSequenceException</A></CODE> - if the array is not sorted.<DT><B>Since:</B></DT>
  <DD>2.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="checkRectangular(long[][])"><!-- --></A><H3>
checkRectangular</H3>
<PRE>
public static void <B>checkRectangular</B>(long[][]&nbsp;in)
                             throws <A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                                    <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Throws DimensionMismatchException if the input array is not rectangular.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>in</CODE> - array to be tested
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if input array is null
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if input array is not rectangular<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="checkPositive(double[])"><!-- --></A><H3>
checkPositive</H3>
<PRE>
public static void <B>checkPositive</B>(double[]&nbsp;in)
                          throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Check that all entries of the input array are strictly positive.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>in</CODE> - Array to be tested
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if any entries of the array are not
 strictly positive.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="checkNonNegative(long[])"><!-- --></A><H3>
checkNonNegative</H3>
<PRE>
public static void <B>checkNonNegative</B>(long[]&nbsp;in)
                             throws <A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></PRE>
<DL>
<DD>Check that all entries of the input array are >= 0.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>in</CODE> - Array to be tested
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></CODE> - if any array entries are less than 0.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="checkNonNegative(long[][])"><!-- --></A><H3>
checkNonNegative</H3>
<PRE>
public static void <B>checkNonNegative</B>(long[][]&nbsp;in)
                             throws <A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></PRE>
<DL>
<DD>Check all entries of the input array are >= 0.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>in</CODE> - Array to be tested
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></CODE> - if any array entries are less than 0.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="safeNorm(double[])"><!-- --></A><H3>
safeNorm</H3>
<PRE>
public static double <B>safeNorm</B>(double[]&nbsp;v)</PRE>
<DL>
<DD>Returns the Cartesian norm (2-norm), handling both overflow and underflow.
 Translation of the minpack enorm subroutine.

 The redistribution policy for MINPACK is available
 <a href="http://www.netlib.org/minpack/disclaimer">here</a>, for
 convenience, it is reproduced below.</p>

 <table border="0" width="80%" cellpadding="10" align="center" bgcolor="#E0E0E0">
 <tr><td>
    Minpack Copyright Notice (1999) University of Chicago.
    All rights reserved
 </td></tr>
 <tr><td>
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 <ol>
  <li>Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.</li>
 <li>Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following
     disclaimer in the documentation and/or other materials provided
     with the distribution.</li>
 <li>The end-user documentation included with the redistribution, if any,
     must include the following acknowledgment:
     <code>This product includes software developed by the University of
           Chicago, as Operator of Argonne National Laboratory.</code>
     Alternately, this acknowledgment may appear in the software itself,
     if and wherever such third-party acknowledgments normally appear.</li>
 <li><strong>WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS"
     WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE
     UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND
     THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES
     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE
     OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY
     OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
     USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF
     THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4)
     DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION
     UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL
     BE CORRECTED.</strong></li>
 <li><strong>LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT
     HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF
     ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT,
     INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF
     ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF
     PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER
     SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT
     (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE,
     EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE
     POSSIBILITY OF SUCH LOSS OR DAMAGES.</strong></li>
 <ol></td></tr>
 </table>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - Vector of doubles.
<DT><B>Returns:</B><DD>the 2-norm of the vector.<DT><B>Since:</B></DT>
  <DD>2.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="sortInPlace(double[], double[]...)"><!-- --></A><H3>
sortInPlace</H3>
<PRE>
public static void <B>sortInPlace</B>(double[]&nbsp;x,
                               double[]...&nbsp;yList)
                        throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></PRE>
<DL>
<DD>Sort an array in ascending order in place and perform the same reordering
 of entries on other arrays. For example, if
 <code>x = [3, 1, 2], y = [1, 2, 3]</code> and <code>z = [0, 5, 7]</code>, then
 <code>sortInPlace(x, y, z)</code> will update <code>x</code> to <code>[1, 2, 3]</code>,
 <code>y</code> to <code>[2, 3, 1]</code> and <code>z</code> to <code>[5, 7, 0]</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - Array to be sorted and used as a pattern for permutation
 of the other arrays.<DD><CODE>yList</CODE> - Set of arrays whose permutations of entries will follow
 those performed on <code>x</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if any <code>y</code> is not the same
 size as <code>x</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>x</code> or any <code>y</code> is null.<DT><B>Since:</B></DT>
  <DD>3.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="sortInPlace(double[], org.apache.commons.math3.util.MathArrays.OrderDirection, double[]...)"><!-- --></A><H3>
sortInPlace</H3>
<PRE>
public static void <B>sortInPlace</B>(double[]&nbsp;x,
                               <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.OrderDirection.html" title="enum in org.apache.commons.math3.util">MathArrays.OrderDirection</A>&nbsp;dir,
                               double[]...&nbsp;yList)
                        throws <A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Sort an array in place and perform the same reordering of entries on
 other arrays.  This method works the same as the other
 <A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#sortInPlace(double[], double[]...)"><CODE>sortInPlace</CODE></A> method, but
 allows the order of the sort to be provided in the <code>dir</code>
 parameter.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - Array to be sorted and used as a pattern for permutation
 of the other arrays.<DD><CODE>dir</CODE> - Order direction.<DD><CODE>yList</CODE> - Set of arrays whose permutations of entries will follow
 those performed on <code>x</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if any <code>y</code> is not the same
 size as <code>x</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>x</code> or any <code>y</code> is null<DT><B>Since:</B></DT>
  <DD>3.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="copyOf(int[])"><!-- --></A><H3>
copyOf</H3>
<PRE>
public static int[] <B>copyOf</B>(int[]&nbsp;source)</PRE>
<DL>
<DD>Creates a copy of the <code>source</code> array.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - Array to be copied.
<DT><B>Returns:</B><DD>the copied array.</DL>
</DD>
</DL>
<HR>

<A NAME="copyOf(double[])"><!-- --></A><H3>
copyOf</H3>
<PRE>
public static double[] <B>copyOf</B>(double[]&nbsp;source)</PRE>
<DL>
<DD>Creates a copy of the <code>source</code> array.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - Array to be copied.
<DT><B>Returns:</B><DD>the copied array.</DL>
</DD>
</DL>
<HR>

<A NAME="copyOf(int[], int)"><!-- --></A><H3>
copyOf</H3>
<PRE>
public static int[] <B>copyOf</B>(int[]&nbsp;source,
                           int&nbsp;len)</PRE>
<DL>
<DD>Creates a copy of the <code>source</code> array.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - Array to be copied.<DD><CODE>len</CODE> - Number of entries to copy. If smaller then the source
 length, the copy will be truncated, if larger it will padded with
 zeroes.
<DT><B>Returns:</B><DD>the copied array.</DL>
</DD>
</DL>
<HR>

<A NAME="copyOf(double[], int)"><!-- --></A><H3>
copyOf</H3>
<PRE>
public static double[] <B>copyOf</B>(double[]&nbsp;source,
                              int&nbsp;len)</PRE>
<DL>
<DD>Creates a copy of the <code>source</code> array.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - Array to be copied.<DD><CODE>len</CODE> - Number of entries to copy. If smaller then the source
 length, the copy will be truncated, if larger it will padded with
 zeroes.
<DT><B>Returns:</B><DD>the copied array.</DL>
</DD>
</DL>
<HR>

<A NAME="linearCombination(double[], double[])"><!-- --></A><H3>
linearCombination</H3>
<PRE>
public static double <B>linearCombination</B>(double[]&nbsp;a,
                                       double[]&nbsp;b)
                                throws <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></PRE>
<DL>
<DD>Compute a linear combination accurately.
 This method computes the sum of the products
 <code>a<sub>i</sub> b<sub>i</sub></code> to high accuracy.
 It does so by using specific multiplication and addition algorithms to
 preserve accuracy and reduce cancellation effects.
 <br/>
 It is based on the 2005 paper
 <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547">
 Accurate Sum and Dot Product</a> by Takeshi Ogita, Siegfried M. Rump,
 and Shin'ichi Oishi published in SIAM J. Sci. Comput.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - Factors.<DD><CODE>b</CODE> - Factors.
<DT><B>Returns:</B><DD><code>&Sigma;<sub>i</sub> a<sub>i</sub> b<sub>i</sub></code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if arrays dimensions don't match</DL>
</DD>
</DL>
<HR>

<A NAME="linearCombination(double, double, double, double)"><!-- --></A><H3>
linearCombination</H3>
<PRE>
public static double <B>linearCombination</B>(double&nbsp;a1,
                                       double&nbsp;b1,
                                       double&nbsp;a2,
                                       double&nbsp;b2)</PRE>
<DL>
<DD>Compute a linear combination accurately.
 <p>
 This method computes a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub> to high accuracy. It does
 so by using specific multiplication and addition algorithms to
 preserve accuracy and reduce cancellation effects. It is based
 on the 2005 paper <a
 href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547">
 Accurate Sum and Dot Product</a> by Takeshi Ogita,
 Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.
 </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a1</CODE> - first factor of the first term<DD><CODE>b1</CODE> - second factor of the first term<DD><CODE>a2</CODE> - first factor of the second term<DD><CODE>b2</CODE> - second factor of the second term
<DT><B>Returns:</B><DD>a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double)"><CODE>linearCombination(double, double, double, double, double, double)</CODE></A>, 
<A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double, double, double)"><CODE>linearCombination(double, double, double, double, double, double, double, double)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="linearCombination(double, double, double, double, double, double)"><!-- --></A><H3>
linearCombination</H3>
<PRE>
public static double <B>linearCombination</B>(double&nbsp;a1,
                                       double&nbsp;b1,
                                       double&nbsp;a2,
                                       double&nbsp;b2,
                                       double&nbsp;a3,
                                       double&nbsp;b3)</PRE>
<DL>
<DD>Compute a linear combination accurately.
 <p>
 This method computes a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub>
 to high accuracy. It does so by using specific multiplication and
 addition algorithms to preserve accuracy and reduce cancellation effects.
 It is based on the 2005 paper <a
 href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547">
 Accurate Sum and Dot Product</a> by Takeshi Ogita,
 Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.
 </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a1</CODE> - first factor of the first term<DD><CODE>b1</CODE> - second factor of the first term<DD><CODE>a2</CODE> - first factor of the second term<DD><CODE>b2</CODE> - second factor of the second term<DD><CODE>a3</CODE> - first factor of the third term<DD><CODE>b3</CODE> - second factor of the third term
<DT><B>Returns:</B><DD>a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double)"><CODE>linearCombination(double, double, double, double)</CODE></A>, 
<A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double, double, double)"><CODE>linearCombination(double, double, double, double, double, double, double, double)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="linearCombination(double, double, double, double, double, double, double, double)"><!-- --></A><H3>
linearCombination</H3>
<PRE>
public static double <B>linearCombination</B>(double&nbsp;a1,
                                       double&nbsp;b1,
                                       double&nbsp;a2,
                                       double&nbsp;b2,
                                       double&nbsp;a3,
                                       double&nbsp;b3,
                                       double&nbsp;a4,
                                       double&nbsp;b4)</PRE>
<DL>
<DD>Compute a linear combination accurately.
 <p>
 This method computes a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> +
 a<sub>4</sub>&times;b<sub>4</sub>
 to high accuracy. It does so by using specific multiplication and
 addition algorithms to preserve accuracy and reduce cancellation effects.
 It is based on the 2005 paper <a
 href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.2.1547">
 Accurate Sum and Dot Product</a> by Takeshi Ogita,
 Siegfried M. Rump, and Shin'ichi Oishi published in SIAM J. Sci. Comput.
 </p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a1</CODE> - first factor of the first term<DD><CODE>b1</CODE> - second factor of the first term<DD><CODE>a2</CODE> - first factor of the second term<DD><CODE>b2</CODE> - second factor of the second term<DD><CODE>a3</CODE> - first factor of the third term<DD><CODE>b3</CODE> - second factor of the third term<DD><CODE>a4</CODE> - first factor of the third term<DD><CODE>b4</CODE> - second factor of the third term
<DT><B>Returns:</B><DD>a<sub>1</sub>&times;b<sub>1</sub> +
 a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> +
 a<sub>4</sub>&times;b<sub>4</sub><DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double)"><CODE>linearCombination(double, double, double, double)</CODE></A>, 
<A HREF="../../../../../org/apache/commons/math3/util/MathArrays.html#linearCombination(double, double, double, double, double, double)"><CODE>linearCombination(double, double, double, double, double, double)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="equals(float[], float[])"><!-- --></A><H3>
equals</H3>
<PRE>
public static boolean <B>equals</B>(float[]&nbsp;x,
                             float[]&nbsp;y)</PRE>
<DL>
<DD>Returns true iff both arguments are null or have same dimensions and all
 their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equals(float, float)"><CODE>Precision.equals(float,float)</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - first array<DD><CODE>y</CODE> - second array
<DT><B>Returns:</B><DD>true if the values are both null or have same dimension
 and equal elements.</DL>
</DD>
</DL>
<HR>

<A NAME="equalsIncludingNaN(float[], float[])"><!-- --></A><H3>
equalsIncludingNaN</H3>
<PRE>
public static boolean <B>equalsIncludingNaN</B>(float[]&nbsp;x,
                                         float[]&nbsp;y)</PRE>
<DL>
<DD>Returns true iff both arguments are null or have same dimensions and all
 their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equalsIncludingNaN(double, double)"><CODE>this method</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - first array<DD><CODE>y</CODE> - second array
<DT><B>Returns:</B><DD>true if the values are both null or have same dimension and
 equal elements<DT><B>Since:</B></DT>
  <DD>2.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="equals(double[], double[])"><!-- --></A><H3>
equals</H3>
<PRE>
public static boolean <B>equals</B>(double[]&nbsp;x,
                             double[]&nbsp;y)</PRE>
<DL>
<DD>Returns <code>true</code> iff both arguments are <code>null</code> or have same
 dimensions and all their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equals(double, double)"><CODE>Precision.equals(double,double)</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - First array.<DD><CODE>y</CODE> - Second array.
<DT><B>Returns:</B><DD><code>true</code> if the values are both <code>null</code> or have same
 dimension and equal elements.</DL>
</DD>
</DL>
<HR>

<A NAME="equalsIncludingNaN(double[], double[])"><!-- --></A><H3>
equalsIncludingNaN</H3>
<PRE>
public static boolean <B>equalsIncludingNaN</B>(double[]&nbsp;x,
                                         double[]&nbsp;y)</PRE>
<DL>
<DD>Returns <code>true</code> iff both arguments are <code>null</code> or have same
 dimensions and all their elements are equal as defined by
 <A HREF="../../../../../org/apache/commons/math3/util/Precision.html#equalsIncludingNaN(double, double)"><CODE>this method</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - First array.<DD><CODE>y</CODE> - Second array.
<DT><B>Returns:</B><DD><code>true</code> if the values are both <code>null</code> or have same
 dimension and equal elements.<DT><B>Since:</B></DT>
  <DD>2.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="normalizeArray(double[], double)"><!-- --></A><H3>
normalizeArray</H3>
<PRE>
public static double[] <B>normalizeArray</B>(double[]&nbsp;values,
                                      double&nbsp;normalizedSum)
                               throws <A HREF="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A>,
                                      <A HREF="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</A></PRE>
<DL>
<DD>Normalizes an array to make it sum to a specified value.
 Returns the result of the transformation <pre>
    x |-> x * normalizedSum / sum
 </pre>
 applied to each non-NaN element x of the input array, where sum is the
 sum of the non-NaN entries in the input array.</p>

 <p>Throws IllegalArgumentException if <code>normalizedSum</code> is infinite
 or NaN and ArithmeticException if the input array contains any infinite elements
 or sums to 0.</p>

 <p>Ignores (i.e., copies unchanged to the output array) NaNs in the input array.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>values</CODE> - Input array to be normalized<DD><CODE>normalizedSum</CODE> - Target sum for the normalized array
<DT><B>Returns:</B><DD>the normalized array.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</A></CODE> - if the input array contains infinite
 elements or sums to zero.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</A></CODE> - if the target sum is infinite or <code>NaN</code>.<DT><B>Since:</B></DT>
  <DD>2.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="buildArray(org.apache.commons.math3.Field, int)"><!-- --></A><H3>
buildArray</H3>
<PRE>
public static &lt;T&gt; T[] <B>buildArray</B>(<A HREF="../../../../../org/apache/commons/math3/Field.html" title="interface in org.apache.commons.math3">Field</A>&lt;T&gt;&nbsp;field,
                                 int&nbsp;length)</PRE>
<DL>
<DD>Build an array of elements.
 <p>
 Arrays are filled with field.getZero()
 </p>
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the field elements<DT><B>Parameters:</B><DD><CODE>field</CODE> - field to which array elements belong<DD><CODE>length</CODE> - of the array
<DT><B>Returns:</B><DD>a new array<DT><B>Since:</B></DT>
  <DD>3.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="buildArray(org.apache.commons.math3.Field, int, int)"><!-- --></A><H3>
buildArray</H3>
<PRE>
public static &lt;T&gt; T[][] <B>buildArray</B>(<A HREF="../../../../../org/apache/commons/math3/Field.html" title="interface in org.apache.commons.math3">Field</A>&lt;T&gt;&nbsp;field,
                                   int&nbsp;rows,
                                   int&nbsp;columns)</PRE>
<DL>
<DD>Build a double dimension  array of elements.
 <p>
 Arrays are filled with field.getZero()
 </p>
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - the type of the field elements<DT><B>Parameters:</B><DD><CODE>field</CODE> - field to which array elements belong<DD><CODE>rows</CODE> - number of rows in the array<DD><CODE>columns</CODE> - number of columns (may be negative to build partial
 arrays in the same way <code>new Field[rows][]</code> works)
<DT><B>Returns:</B><DD>a new array<DT><B>Since:</B></DT>
  <DD>3.2</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MathArrays.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/util/IterationManager.html" title="class in org.apache.commons.math3.util"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/util/MathArrays.Function.html" title="interface in org.apache.commons.math3.util"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/util/MathArrays.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MathArrays.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
